
import Vue from 'vue'

const component = {
    template: `
        <div>
            <input type="text" :value="value" @input="handleInput"/>
        </div>
    `,
    props: ["value"],
    methods: {
        handleInput(e){
            this.$emit('input', e.target.value)
        }
    }
}

new Vue({
    components: {
        CompOne: component
    },
    el: '#root',
    data:{
        value: '123'
    },
    // <comp-one :value="value" @input="value = arguments[0]"></comp-one>
    template: `
        <div>
            <comp-one v-model="value"></comp-one>
            <p v-text="value"></p>
        </div>
    `
})


